<?php # Левое меню

class video_menu_left extends Load_use
{
	function getBlock()
	{
		$html = '';

		$this->conn->query('SELECT distinct v.video_page_id, p.title FROM `video` v
							join pages p on p.id = v.video_page_id');

		$i = 1;

		while( $row = $this->conn->fetch() )
		{
			$html .= '
			<li class="'.( ( isset($_GET['video_cat']) && $_GET['video_cat'] == $row->video_page_id ) ? 'selected' : ( (!isset($_GET['video_cat']) and $i == 1) ? 'selected' : '' ) ).' '.( ( strlen($row->title) > 48 ) ? 'two_lines' : '' ).'">
				<span><a href="'.$this->view->url.'/?video_cat='.$row->video_page_id.'">'.$row->title.'</a></span>
			 </li>';

			$i++;
		}

 		return '<ul class="sidebar__navi video_navi">
					'.$html.'
				</ul>';
	}
}